﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace VERKProjectHopur16.Models
{
    public class QAAnswerModel
    {
        /// <summary>
        /// This model is user in UserController
        /// </summary>
        #region Repository instance
        ContentDBDataContext m_db = new ContentDBDataContext();
        #endregion

        #region Properties
        public int QAID { get; set; }

        [Required(ErrorMessage = "Field required")]
        public String Answer { get; set; }

        public QA Question()
        {
            var result = (from Q_A in m_db.QAs
                          where Q_A.QAID == QAID
                          select Q_A).SingleOrDefault();
            return result;
        }
        #endregion
    }
}